package com.hexinfo.dmpro.sparing.service.impl;


import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.file.FileAppender;
import cn.hutool.core.util.StrUtil;
import com.hexinfo.dmpro.common.model.MessageCenter;
import com.hexinfo.dmpro.common.service.MessageCenterService;
import com.hexinfo.dmpro.common.utils.ScanCommonConstants;
import com.hexinfo.dmpro.sparing.dto.DistCPDTO;
import com.hexinfo.dmpro.sparing.model.SyncCompleteLibrary;
import com.hexinfo.dmpro.sparing.model.UatSyncLogs;
import com.hexinfo.dmpro.sparing.service.BackupSourceService;
import com.hexinfo.dmpro.sparing.service.DistCPService;
import com.hexinfo.dmpro.sparing.service.HotStandbyLogTableService;
import com.hexinfo.dmpro.sparing.service.XxJobLogService;
import com.hexinfo.dmpro.sparing.util.Logger;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Service
@Slf4j
public class XxJobLogServiceImpl implements XxJobLogService {
    @Autowired
    private MessageCenterService messageCenterService;

    /**
     * 推送日志信息到调度
     * @param id 消息中心ID
     */
    @Override
    public void messageToXxlJob(String id) {
        MessageCenter messageCenter = messageCenterService.getById(id);
        log.warn("推送调度==========="+messageCenter.getMessageSubject());
        Logger.log(messageCenterService.readLoadLog(messageCenter.getLogPath()));
    }
}
